﻿#region Styx Namespaces
using Styx;
using Styx.CommonBot.Routines;
using Styx.WoWInternals;
#endregion

namespace GiwinMonk
{
    public partial class Monk : CombatRoutine
    {
        public void Approach()
        {
            if (StyxWoW.Me.CurrentTarget != null &&
                !StyxWoW.Me.IsFacing(StyxWoW.Me.CurrentTarget))
            {
                WoWMovement.ConstantFace(StyxWoW.Me.CurrentTargetGuid);
            } 
            if (StyxWoW.Me.CurrentTarget != null &&
                 StyxWoW.Me.CurrentTarget.Distance < 3 && !StyxWoW.Me.CurrentTarget.IsMoving)
            {
                WoWMovement.MoveStop();
            }
            if (StyxWoW.Me.CurrentTarget != null &&
                !StyxWoW.Me.IsAutoAttacking && !StyxWoW.Me.IsCasting && !StyxWoW.Me.IsChanneling)
            {
                StyxWoW.Me.ToggleAttack();
            }
            if (StyxWoW.Me.CurrentTarget != null &&
                StyxWoW.Me.CurrentTarget.Distance < 4 && StyxWoW.Me.CurrentTarget.Distance <= 10)
            {
                Styx.Pathing.Navigator.MoveTo(StyxWoW.Me.CurrentTarget.Location);
            }
            if (StyxWoW.Me.CurrentTarget != null && StyxWoW.Me.CurrentTarget.Distance >= 6 && Roll())
            {
                InstantCast("Roll");
                Styx.Pathing.Navigator.MoveTo(StyxWoW.Me.CurrentTarget.Location);
            }
            if (StyxWoW.Me.CurrentTarget != null && StyxWoW.Me.CurrentTarget.Distance >= 10 && FlyingSerpentKick())
            {
                InstantCast("Flying Serpent Kick");
                Styx.Pathing.Navigator.MoveTo(StyxWoW.Me.CurrentTarget.Location);
            }
            if (StyxWoW.Me.CurrentTarget != null && !Roll() && !FlyingSerpentKick())
            {
                Styx.Pathing.Navigator.MoveTo(StyxWoW.Me.CurrentTarget.Location);
            }
        }
    }
}
    

